<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		
	</head>
	<body>
		<div id="app4" v-cloak>
			<input type="text" v-model.lazy="text" /><br/>{{reversedStr}}<br/>{{reversedStr}}
			<br />
			<input type="text" v-model="text2" />
			{{text3}}<br />
			<!-- {{res()}}<br /> -->
			<button @click="res()">按钮</button>
			<!-- {{res()}} -->
		</div>
		
		<script src="../vue.js"></script>
		<script>
			const a2 = new Vue({
				el: '#app4',
				data: {
					text: 'iofegcbdb',
					text2: '',
					text3: ''
				},
				methods:{
					res: function(){
						console.log("方法执行")
						this.text3 = this.text3.split('').reverse().join('')
					}
				},
				computed:{
					reversedStr(){
						console.log("计算属性")
						return this.text.split('').reverse().join('')
					}
				}
			})
		</script>
	</body>
</html>
